package com.zy.bean.vo;

import com.zy.bean.po.RuleComponent;
import lombok.Data;

import java.util.Date;

/**
 * @author : hanhuafeng
 * @date : 2023/10/7 15:01
 */
@Data
public class SystemCmpVo {
    /**
     * 组件编码
     */
    private String code;
    /**
     * 组件名称
     */
    private String cmpId;

    /**
     * 组件类型
     */
    private String cmpType;

    /**
     * 默认展示内容
     */
    private String defaultText;

    /**
     * 参数
     */
    private String params;

    /**
     * 插入时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    public static SystemCmpVo trance(RuleComponent ruleComponent) {
        SystemCmpVo systemCmpVo = new SystemCmpVo();
        systemCmpVo.setCode(ruleComponent.getCode());
        systemCmpVo.setCmpId(ruleComponent.getCmpId());
        systemCmpVo.setCmpType(ruleComponent.getCmpType());
        systemCmpVo.setDefaultText(ruleComponent.getDefaultText());
        systemCmpVo.setParams(ruleComponent.getParams());
        systemCmpVo.setCreateTime(ruleComponent.getCreateTime());
        systemCmpVo.setUpdateTime(ruleComponent.getUpdateTime());
        return systemCmpVo;
    }
}
